<!DOCTYPE html>
<html lang="zh-cmn-Hans">

<head>
    <meta charset="UTF-8">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <meta content="yes" name="apple-mobile-web-app-capable" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style" />
    <meta name="format-detection" content="telephone=no" />
    <link rel="stylesheet" href="../../static/mobile/default/css/layout.css?v=2" />
    <link rel="icon" type="image/png" href="../../static/favicon.ico" />
    <script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
    <script src="../../static/js/jquery/jquery/2.1.4/jquery.min.js"></script>
    <script src="../../static/js/jquery/jquery.cookie.js"></script>
    <title>会员中心 - 达漂亮</title>

    <link rel="stylesheet" href="../../static/assets/css/zpui.css" />
    <link rel="stylesheet" href="../../static/assets/css/all.css" />
    <!--<script src="../../static/assets/js/page.js"></script>-->
    <script src="../../static/mobile/default/js/page.js?v=1"></script>
    <link rel="stylesheet" href="../../static/mobile/default/css/my.css" />

</head>

<body>
    <div class="page ">

        <div class="page">
            <div class="page-hd">
                <div class="header bor-1px-b">
                    <div class="header-left">
                        <a href="javascript:history.go(-1)" class="left-arrow"></a>
                    </div>
                    <div class="header-title">个人中心</div>
                    <div class="header-right">
                        <a href="#"></a>
                    </div>
                </div>
            </div>

            <div class="page-bd">
                <!-- 页面内容-->
                <div class="user_info_cells">
                    <div class="weui-cell">
                        <div class="weui-cell__hd">
                            <div class="avatar">
                                <a style="width: 100%;height: 100%;" href="../../member/center/userinfo.html">
                                    <img src="../../static/mobile/default/images/defheadimg.jpg" alt="" class="headImage"></a>
                            </div>
                        </div>
                        <div class="weui-cell__bd">
                            <div class="fs30 userName"></div>
                            <div>
                                <span class="fs26 mr10">ID：5000000<span class="id"></span></span>
                                <span class="sf_btn level"></span>
                            </div>
                            <div class="fs26" style="display: flex;    align-items: center;">推荐人：<img src="../../static/mobile/default/images/defheadimg.jpg" alt="" class="proImage" style=" width: .23rem;height:.23rem; border-radius: 50%"><span class="reference fs26">暂无</span></div>
                        </div>
                    </div>
                </div>
                <script>
                    getUserInfo()

                    //获取用户信息
                    function getUserInfo() {
                        var test = $.cookie('code')
                        console.log(test)
                        $.ajax({
                            url: 'https://mp.jianguoes.com/api/mp/getUserInfo', // 跳转到 action
                            data: {},
                            type: 'get',
                            headers: {
                                token: $.cookie('code')
                            },
                            dataType: 'json',
                            success: function(res) {
                                console.log(res);
                                if (res.errno == 0) {
                                    $('.userName').text(res.data.nickname)
                                    $('.id').text(res.data.userId)
                                    $('.reference').text(res.data.promoterName)
                                    if (res.data.promoterName && res.data.promoterAvatar) {
                                        $('.proImage').show()
                                        $('.proImage').attr('src', res.data.promoterAvatar)
                                    } else {
                                        $('.proImage').hide()
                                    }
                                    if (res.data.promoterId) {
                                        $('.mysupplier').attr('href', "../../user/user/mysupplier.html")
                                    } else {
                                        $('.mysupplier').attr('href', "../../user/user/nosupplier.html")
                                    }
                                    $('.headImage').attr("src", res.data.avatar)
                                    $('.allProfit').text(res.data.mlsuser.allProfit)
                                    if (res.data.isReal == 1) {
                                        $('.crush').attr('href', '../../user/user/contract/auth.html')
                                    } else {
                                        $('.crush').attr('href', '../../user/user/contract/contract.html')
                                    }

                                    if (res.data.user_level_id != 1) {
                                        $('.initiate').attr('href', '../../user/user/Initiate.html')
                                        $('.initiate').css('display', 'block')
                                    }
                                    if (res.data.user_level_id == 1) {
                                        $('.level').text('游客')
                                    } else if (res.data.user_level_id == 2) {
                                        $('.level').text('VIP')
                                    } else if (res.data.user_level_id == 3) {
                                        $('.level').text('合伙人')
                                    } else if (res.data.user_level_id == 4) {
                                        $('.level').text('大区合伙人')
                                    } else if (res.data.user_level_id == 5) {
                                        $('.level').text('联合创始人')
                                    } else if (res.data.user_level_id == 6) {
                                        $('.level').text('战略合作商')
                                    }else if (res.data.user_level_id == 7) {
                                        $('.level').text('总公司')
                                    }

                                    if (res.data.user_level_id == 1 || res.data.user_level_id == 2) {
                                        $('.proxy').hide()
                                    } else {
                                        $('.proxy').show()
                                    }
                                }

                            },
                            error: function() {

                            }
                        });
                    }
                </script>
                <div class="card-flex card-box">
                    <!-- <div class="flex_item">
                        <a href="../../user/user/mydepository.html">
                            <div class="fs38 font_number">140</div>
                            <div class="fs26 text-gray2">云仓库存</div>
                        </a>
                    </div>
                    <div class="flex_item">
                        <a href="../../user/user/settlementlog.html">
                            <div class="fs38 font_number">0</div>
                            <div class="fs26 text-gray2">待结算</div>
                        </a>
                    </div> -->
                    <div class="flex_item">


                        <a href="../../user/user/withdraw.html" style="    display: flex;
    justify-content: center;
    align-items: center;">
                            <div class="weui-grid__icon" style="margin:0 .2rem 0 0;    width: 50px;
    height: 50px;">
                                <img src="../../static/assets/images/tool_icon_01.png" alt="">
                            </div>

                            <div class="fs26 text-gray2">
                                <div class="fs38 font_number  allProfit"></div>
                                可用余额
                            </div>
                        </a>
                    </div>
                </div>
                <div class="card-box" style="margin-bottom:0.766667rem;">
                    <div class="weui-panel">
                        <div class="weui-panel__hd">
                            <span class="panel_tit">我的服务</span>
                        </div>
                        <div class="weui-panel__bd">
                            <div class="weui-grids mytool_grids">
                                <a href="../../user/user/moneylog.html" class="weui-grid">
                                    <div class="weui-grid__icon">
                                        <img src="../../static/assets/images/tool_icon_15.png" alt="">
                                    </div>
                                    <p class="weui-grid__label">
                                        资金明细
                                    </p>
                                </a>
                                <a href="../../user/user/capital.html" class="weui-grid">
                                    <div class="weui-grid__icon">
                                        <img src="../../static/assets/images/tool_icon_02.png" alt="">
                                    </div>
                                    <p class="weui-grid__label">
                                        我的报表
                                    </p>
                                </a>
                                <a href="../../member/center/mycode.html" class="weui-grid">
                                    <div class="weui-grid__icon">
                                        <img src="../../static/assets/images/tool_icon_03.png" alt="">
                                    </div>
                                    <p class="weui-grid__label">
                                        我要推广
                                    </p>
                                </a>
                                <a href="../../user/user/management.html" class="weui-grid">
                                    <div class="weui-grid__icon">
                                        <img src="../../static/assets/images/tool_icon_04.png" alt="">
                                    </div>
                                    <p class="weui-grid__label">
                                        会员管理
                                    </p>
                                </a>
                                <a href="../../member/center/address.html" class="weui-grid">
                                    <div class="weui-grid__icon">
                                        <img src="../../static/assets/images/tool_icon_05.png" alt="">
                                    </div>
                                    <p class="weui-grid__label">
                                        地址管理
                                    </p>
                                </a>

                                <a href="../../user/user/bindphone.html" class="weui-grid">
                                    <div class="weui-grid__icon">
                                        <img src="../../static/assets/images/tool_icon_07.png" alt="">
                                    </div>
                                    <p class="weui-grid__label">
                                        绑定手机号
                                    </p>
                                </a>
                                <a class="weui-grid " href="../../user/user/userroll.html">
                                    <div class="weui-grid__icon">
                                        <img src="../../static/assets/images/tool_icon_09.png" alt="">
                                    </div>
                                    <p class="weui-grid__label">
                                        现金劵
                                    </p>
                                </a>
                                <a class="weui-grid crush">
                                    <div class="weui-grid__icon">
                                        <img src="../../static/assets/images/tool_icon_13.png" alt="">
                                    </div>
                                    <p class="weui-grid__label">
                                        我的合同
                                    </p>
                                </a>
                                <a class="weui-grid  initiate" style="display:none;">
                                    <div class="weui-grid__icon">
                                        <img src="../../static/assets/images/tool_icon_10.png" alt="">
                                    </div>
                                    <p class="weui-grid__label">
                                        我要经营
                                    </p>
                                </a>
                                <a class="weui-grid  " href="../../user/user/kefu.html">
                                    <div class="weui-grid__icon">
                                        <img src="../../static/assets/images/tool_icon_08.png" alt="">
                                    </div>
                                    <p class="weui-grid__label">
                                        联系客服
                                    </p>
                                    <a href="../../user/user/pageTopic.html" class="weui-grid">
                                        <div class="weui-grid__icon">
                                            <img src="../../static/assets/images/tool_icon_06.png" alt="">
                                        </div>
                                        <p class="weui-grid__label">
                                            素材号
                                        </p>
                                    </a>
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="card-box proxy" style="margin-bottom:0.766667rem;">
                    <div class="weui-panel">
                        <div class="weui-panel__hd">
                            <span class="panel_tit">代理服务</span>
                        </div>
                        <div class="weui-panel__bd">
                            <div class="weui-grids mytool_grids">
                                <!--<a href="../../user/user/agentdetails.html" class="weui-grid">-->
                                <!--    <div class="weui-grid__icon">-->
                                <!--        <img src="../../static/assets/images/tool_icon_08.png" alt="">-->
                                <!--    </div>-->
                                <!--    <p class="weui-grid__label">-->
                                <!--        代理详情-->
                                <!--    </p>-->
                                <!--</a>-->
                                <!--<a href="../../user/user/userroll.html" class="weui-grid">-->
                                <!--    <div class="weui-grid__icon">-->
                                <!--        <img src="../../static/assets/images/tool_icon_09.png" alt="">-->
                                <!--    </div>-->
                                <!--    <p class="weui-grid__label">-->
                                <!--        提货券-->
                                <!--    </p>-->
                                <!--</a>-->
                                <!--<a href="../../user/user/mydepository.html" class="weui-grid">-->
                                <!--    <div class="weui-grid__icon">-->
                                <!--        <img src="../../static/assets/images/tool_icon_10.png" alt="">-->
                                <!--    </div>-->
                                <!--    <p class="weui-grid__label">-->
                                <!--        我的库存-->
                                <!--    </p>-->
                                <!--</a>-->

                                <a class="weui-grid  mysupplier">
                                    <div class="weui-grid__icon">
                                        <img src="../../static/assets/images/tool_icon_12.png" alt="">
                                    </div>
                                    <p class="weui-grid__label">
                                        我的供应商
                                    </p>
                                </a>
                                <a href="../../user/user/wholesaler.html" class="weui-grid">
                                    <div class="weui-grid__icon">
                                        <img src="../../static/assets/images/tool_icon_15.png" alt="">
                                    </div>
                                    <p class="weui-grid__label">
                                        经销商管理
                                    </p>
                                </a>
                                <a href="../../user/user/wholesaler1.html" class="weui-grid">
                                    <div class="weui-grid__icon">
                                        <img src="../../static/assets/images/tool_icon_11.png" alt="">
                                    </div>
                                    <p class="weui-grid__label">
                                        平级经销商管理
                                    </p>
                                </a>
                                <a href="../../user/user/agentset.html" class="weui-grid">
                                    <div class="weui-grid__icon">
                                        <img src="../../static/assets/images/tool_icon_14.png" alt="">
                                    </div>
                                    <p class="weui-grid__label">
                                        设定代理身份
                                    </p>
                                </a>
                                <!--<a href="../../user/user/rebatelog.html" class="weui-grid">-->
                                <!--    <div class="weui-grid__icon">-->
                                <!--        <img src="../../static/assets/images/tool_icon_15.png" alt="">-->
                                <!--    </div>-->
                                <!--    <p class="weui-grid__label">-->
                                <!--        返利明细-->
                                <!--    </p>-->
                                <!--</a>-->
                                <!--<a href="../../user/user/contract/auth.html" class="weui-grid">-->
                                <!--    <div class="weui-grid__icon">-->
                                <!--        <img src="../../static/assets/images/tool_icon_15.png" alt="">-->
                                <!--    </div>-->
                                <!--    <p class="weui-grid__label">-->
                                <!--        我的合同-->
                                <!--    </p>-->
                                <!--</a>-->

                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div>
        <script>
            let is_exist = "1";
            let timestamp = (new Date()).getTime();
            $(function() {

                let time = localStorage.getItem('time');
                let differ_time = timestamp - time;
                if (is_exist == 0 && differ_time > (86400 * 1000)) {
                    $.alert('请先请添加提现方式', function() {
                        window.location.href = "/member/withdraw/banklist.html";
                        localStorage.setItem('time', timestamp);
                    })
                }
            })

            share()

            function share() {
                /***用户点击分享到微信圈后加载接口接口*******/
                var url = window.location.href;
                console.log("url:" + url);
                $.ajax({
                    url: "/api/mp/wxconfig",
                    type: "post",
                    data: {
                        shareUrl: url
                    },
                    headers: {
                        token: $.cookie('code')
                    },
                    dataType: "json",
                    success: function(data) {
                        configData = {
                            debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
                            appId: data.data.appid, // 必填，公众号的唯一标识
                            timestamp: data.data.timestamp, // 必填，生成签名的时间戳
                            nonceStr: data.data.nonceStr, // 必填，生成签名的随机串
                            signature: data.data.signature, // 必填，签名，见附录1
                            jsApiList: ['hideOptionMenu']
                                // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
                        };

                        //step2:注入配置信息
                        wx.config(configData);
                        //step3:通过ready接口处理成功验证
                        wx.ready(function() {
                            // config信息验证后会执行ready方法，所有接口调用都必须在config接口获得结果之后，config是一个客户端的异步操作，所以如果需要在页面加载时就调用相关接口，则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口，则可以直接调用，不需要放在ready函数中。
                            //                 alert("执行ready方法");
                            //                 wx.checkJsApi({
                            //                      jsApiList: ['chooseImage'] // 需要检测的JS接口列表，所有JS接口列表见附录2,
                            //                      success: function(res) {
                            //                      // 以键值对的形式返回，可用的api值true，不可用为false
                            //                      // 如：{"checkResult":{"chooseImage":true},"errMsg":"checkJsApi:ok"}
                            //                      }
                            //                 });
                            //接口1:获取网络类型
                            wx.getNetworkType({
                                success: function(res) {
                                    oldNet = res.networkType; // 返回网络类型2g，3g，4g，wifi
                                    //                        alert("网络类型"+ oldNet);
                                }
                            });
                            //禁用右上角菜单按钮
                            wx.hideOptionMenu();
                        })
                    },
                    error: function() {
                        // 			    _alert('ajax request failed!!!!');
                        return;
                    }
                })



            }
        </script>
        <div class="copyright">
            Copyright © 达漂亮<br>
        </div>
        <div class="bottom-tabbar-wrapper">
            <div class="bottom-tabbar">
                <a href="../../index.html" class="bottom-tabbar__item">
                    <span class="icon">
                        <img src="../../static/menuimg/footer_index_a.png" />
                        <img class="lhimg" src="../../static/menuimg/footer_index_b.png" />
                    </span>
                    <p class="label">首页</p>
                </a>
                <!-- <a href="../../shop/index/allsort.html" class="bottom-tabbar__item">
        <span class="icon">
            <img src="../../static/menuimg/footer_cat_a.png"/>
            <img class="lhimg" src="../../static/menuimg/footer_cat_b.png"/>
        </span>
          <p class="label">分类</p>
      </a> -->
                <a href="../../static/res/index.html" class="bottom-tabbar__item">
                    <span class="icon">
                        <img src="../../static/assets/images/res/10.png" />
                        <img class="lhimg" src="../../static/assets/images/res/11.png" />
                    </span>
                    <p class="label">孝邻会</p>
                </a>
                <a href="../../shop/order/index.html" class="bottom-tabbar__item">
                    <span class="icon">
                        <img src="../../static/menuimg/footer_cat_a.png" />
                        <img class="lhimg" src="../../static/menuimg/footer_cat_b.png" />
                    </span>
                    <p class="label">我的订单</p>
                </a>
                <a href="./index.html" class="bottom-tabbar__item active">
                    <span class="icon">
                        <img src="../../static/menuimg/footer_user_a.png" />
                        <img class="lhimg" src="../../static/menuimg/footer_user_b.png" />
                    </span>
                    <p class="label">我的</p>
                </a>
            </div>
        </div>
        <script>
            var index = -1;

            function setSelect(url) {
                $('.bottom-tabbar a').each(function(i, val) {
                    var thisUrl = $(this).attr('href');
                    var sear = new RegExp(thisUrl);
                    if (sear.test(url)) {
                        index = i;
                    }
                });
            }
            $(function() {
                var curUrl = window.location.href;
                setSelect(curUrl);
                if (index == -1) {
                    var referrer = document.referrer;
                    setSelect(referrer);
                }
                $('.bottom-tabbar a').eq(index).addClass('active');
            })
        </script>
    </div>

    <script src="../../static/js/art-template.js"></script>
    <script src="../../static/mobile/default/js/lib/fastclick.js"></script>
    <script src="../../static/js/jquery/lazyload/jquery.lazyload.js"></script>
    <script src="../../static/js/jquery/jquery.cookie.js"></script>
    <script>
        $(function() {
            FastClick.attach(document.body);
            $("img.lazy").lazyload({
                effect: "fadeIn",
                event: "scroll",
                container: $(".page-bd")
            });
        });
    </script>

    <script src="../../static/assets/js/lib/jquery-2.1.4.js"></script>
    <script src="../../static/assets/js/jquery-weui.min.js"></script>

    <script src="../../static/assets/js/lib/fastclick.js"></script>

    <div class="alertBox">
        <div class="alertBG"></div>
        <div class="alert">
            <div class="text fs30 color_3 bor_b">

            </div>
            <!-- 单按钮 -->
            <div class="button fs32 fw_b color_r">
                知道了
            </div>
            <!-- 双按钮 -->
            <div class="buttonBox fs32 fw_b">
                <span class="color_9 bor_r cancel">取消</span>
                <span class="color_r confirm">确定</span>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        var is_xcx = 0;
        $(document).on('click', 'a', function() {
            var href = $(this).attr('href');
            if (href.indexOf('/pages') != -1) {
                if (is_xcx == 1) {
                    wx.miniProgram.navigateTo({
                        url: href
                    })
                    return false;
                } else {
                    return false;
                }
            }
        })
    </script>
</body>

</html>